package com.springBoot.DataSource01.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.springBoot.DataSource01.mapper.UserMapper01;
import com.springBoot.DataSource01.service.UserService01;
import com.springBoot.pojo.User;
@Service("userServiceImpl01")
public class UserServiceImpl01 implements UserService01{
	
	@Autowired
	private UserMapper01 userMapper01;

	
	public PageInfo<User> getUserList(int page,int pageSize) {
		PageHelper.startPage(page, pageSize);
		List<User> userList = userMapper01.getUserList(page,pageSize);
		PageInfo<User> pageInfo = new PageInfo<User>(userList);
		return pageInfo;
	}
	
	@Transactional(transactionManager = "test1TransactionManager")
	public Integer addUser(String loginName,int i) {
		int addUser1 = userMapper01.addUser(loginName,"x徐晓辉","123");
		int j = 1/i;
		System.err.println(j);
		return addUser1;
	}

}
